1
//-------------------------------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 //-------------------------------------------------------------------------------------------------
16 void Swap(_Inout_ T
**left
, _Inout_ T
**right
) throw()
23 //-------------------------------------------------------------------------------------------------
25 // Useful CompileTime function that will allow you to assert an inheritance relationship between
26 // two types. Very helpful in certain template sceanrios.
28 // Use a static cast here because it will prevent operator consideration.
30 //-------------------------------------------------------------------------------------------------
31 template <typename Parent
, typename Child
>
33 void CompileAssertIsChildOf()
36 Parent
*pParent
= NULL
;
38 pParent
= static_cast<Parent
*>(pChild
);
42 //-------------------------------------------------------------------------------------------------
44 // Several of our hashing algorithms require the size of a key be a multiple of the size of
45 // a pointer. This function will prevent a compilation in DEBUG mode unless this is satisifed
47 //-------------------------------------------------------------------------------------------------
50 void CompileAssertSizeIsPointerMultiple()
53 COMPILE_ASSERT(0 == (sizeof(T
) % sizeof(void*)));